using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace WorkFlow.Data
{
    public class DataBase<T> : ScriptableObject where T:DataBase<T>
    {
        public static bool LiveIs => _instance;
        
        private static T _instance;
        public static T Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = Resources.Load<T>(typeof(T).Name);
                }
                return _instance;
            }
        }

        private void Awake()
        {
            _instance = this as T;
        }
    }
}

